
<script>
	export default {
		onLaunch: function() {
			//#ifdef APP-PLUS
			this.checkVersion()
			//#endif
			//**************************中电万维单点登录　开始***********************************//
			//#ifdef H5
			 var search = window.location.search;
			　if(search.indexOf('?')>-1){
			  　　var requestParameter = this.$common.getParameter();
				  alert(requestParameter['token']);
				  var code = requestParameter['token'];
			      console.log(code)
			      //获取AccessToken
				  if(this.$common.isEmpyt(code)){
					code = 'naturalToken8374398238430780480718956629585764406416024208446130798242954359'  
				  }
			     this.$zdwwApi.doSSo(code);
			  }else{
				window.location.assign(this.$common.sys.ssoUrl+"="+this.$common.sys.redirectUri);
			  }
			//#endif
			//**************************中电万维单点登录　结束***********************************//
		},
		onShow: function() {
			// console.log('App Show')
		},
		onHide: function() {
			// console.log('App Hide')
		},
		methods: {
			getUserInfo(accessToken){
				uni.request({
					url: this.$common.sys.ssoUrl+"/connect/oauth/me/userinfo",
					method: 'post',
					header: {'Authorization':'Bearer '+accessToken},
					success: function(res) {
						console.debug(res)
					}
				});
			},
			
			doLogin(userInfo,callBack){
				uni.request({
					url: this.$common.sys.ssoUrl+"/connect/oauth/token?response_type=token&code="+code,
					method: 'post',
					success: function(res) {
							console.log(res)
					}
				});
			},
			
			// app更新检测
			checkVersion() {
				// 获取应用版本号
				let version = plus.runtime.version

				//检测当前平台，如果是安卓则启动安卓更新
				uni.getSystemInfo({
					success: res => {
						this.updateHandler(res.platform, version)
					}
				})
			},
			// 更新操作
			updateHandler(platform, version) {
				console.log(platform)
				console.log(version)
				let data = {
					TYPE: platform
				}
				let _this = this;
				this.$request('S1016', data, 'POST', function(res) {
					if (res.data.CODE == 0) {
						const info = res.data
						if (info.DATA.VERSION !== '' && info.DATA.VERSION > version) {
							if (plus.networkinfo.getCurrentType() != 3) {
								uni.showToast({
									title: '有新的版本发布，检测到您目前非Wifi连接，为节约您的流量，程序已停止自动更新，将在您连接WIFI之后重新检测更新。',
									mask: false,
									duration: 5000,
									icon: "none"
								});
								return;
							}
							uni.showModal({
								//提醒用户更新
								title: '有新的版本发布',
								content: '请更新后使用',
								showCancel: false,
								 buttonText: '确定',
								success: res => {
									if (res.confirm) {
										var dtask = plus.downloader.createDownload(_this.$common.sys.baseUrl + '/appfiles/' + info.DATA.FILENAME, {},
											function(d, status) {
												// 下载完成  
												if (status == 200) {
													plus.runtime.install(plus.io.convertLocalFileSystemURL(d.filename), {}, {}, function(error) {
														uni.showToast({
															title: '安装失败',
															mask: false,
															duration: 1500
														});
													})
												} else {
													uni.showToast({
														title: '更新失败',
														mask: false,
														duration: 1500
													});
												}
											});
										dtask.start();
									}
								}
							})

						}
					} else {
						self.$common.errorToShow(res.data.MSG);
					}

				})
			}
		}
	}
</script>

<style lang="scss">
	/*每个页面公共css */
	* {

		font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
	}

	.article-content {
		p {
			margin: 0 auto 17px auto;
			text-align: justify;
			// text-indent: 2em;
		}
	}

	.my-list {
		.uni-list-item__container {
			.uni-list-item__content {
				display: flex;
				flex-direction: row;
				justify-content: space-between;
			}
		}

		.uni-list-item__extra {
			width: 50upx !important;
		}
	}

	.legend {
		display: block;
		width: 190upx;
		margin-top: -26upx;
		margin-left: 36upx;
		text-align: center;
		font-size: 18px;
		background: #fff;
	}

	.text-center {
		text-align: center;
	}

	.uni-list:before,
	.uni-list:after {
		background-color: transparent !important;
	}

	.uni-list-cell__content-title {
		font-size: 16px !important;
		color: #2c3e50 !important;
	}

	.content .uni-form {
		flex: 1;
	}

	.record-wrap {
		padding: 30upx;
		color: #2c3e50;
	}

	.body {
		padding: 0 20upx;

		.uni-list-item {
			width: 710upx;
			color: #606266;
		}
	}

	.uni-list-item {
		width: 730upx;
		font-size: 16px;
		color: #606266 !important;
		line-height: 30px;
	}

	.image-wrap {
		padding: 10upx 20upx 30upx;
		display: flex;
		justify-content: flex-start;
		flex-direction: row;
		flex-wrap: wrap;
	}

	.image-item {
		position: relative;
		width: 180upx;
		height: 240upx;
		margin-top: 30upx;
		margin-left: 30upx;
		margin-right: 30upx;
	}

	.result-fj {
		width: 750upx;
		height: 340upx;
		padding-top:20upx;
		white-space: nowrap;
		.image-item-a{
			display: inline-block!important;
			width: 180upx;
			height: 240upx;
		}
		.image-item-a+.image-item-a{
			margin-left: 20upx;
		}
	}

	.image-item .close {
		box-sizing: border-box;
		position: absolute;
		top: -10upx;
		left: 0;
		z-index: 99;
		width: 100%;
		height: 0upx;
		background: rgba(0, 0, 0, 0.3);
		display: flex;
		justify-content: flex-end;
		padding-right: 2upx;
		overflow: hidden;
		transition: height 0.5s ease;
	}

	.hover-image.image-item .close {
		height: 50upx;
	}

	.uni-list-item .sub_title {
		display: flex;
		justify-content: space-between;
		color: #909399;
	}

	.uni-form-item {
		/* background-image: linear-gradient(180deg, #d9d9d9, #d9d9d9 50%, transparent 50%); */
		background-image: linear-gradient(180deg, #d9d9d9, #d9d9d9 50%, #F2F6FC 50%);
		background-size: 120% 1px;
		background-repeat: no-repeat;
		background-position: top left;
		background-origin: content-box;
		box-sizing: border-box;
		display: flex;
		flex-direction: row;
		flex-wrap: nowrap;
		padding: 0 20upx;
		align-items: center;
		line-height: 48px;
	}

	.uni-form-item .title {
		// #ifdef H5
		width: 230upx !important;
		// #endif

		// #ifdef APP-PLUS || MP
		width: 250upx !important;
		// #endif

		color: #606266;
		font-size: 16px;
		text-align: left;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.uni-form-item .uni-input {
		font-size: 16px;
		color: #606266;
	}

	.my-popup .uni-popup__wrapper-box {
		padding: 0 !important;
		line-height: 79upx;
	}

	.my-popup .uni-popup__wrapper-box .value-text {
		display: flex;
		justify-content: flex-start;
		flex-direction: row;
		flex-wrap: nowrap;
		height: 79upx;
		color: #42b983;
		font-size: 14px;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;

		.text-val+.text-val {
			padding-left: 15upx;
		}
	}

	.uni-scroll-view-list {
		box-sizing: border-box;
		// #ifdef H5
		height: calc(100% - 44px);
		// #endif

		// #ifdef APP-PLUS || MP
		height: 100%;
		// #endif
		padding-left: 20upx;
	}

	.fiexd-top {
		box-sizing: border-box;
		display: flex;
		justify-content: space-between;
		flex-wrap: nowrap;
		position: fixed;
		// #ifdef H5
		top: 44px;
		// #endif
		// #ifdef APP-PLUS || MP
		top: 0;
		// #endif


		left: 0;
		z-index: 9;
		width: 100%;
		height: 36px;
		padding: 0 20upx;
		line-height: 36px;
		background-color: #26a2ff;
		color: #fff;
		font-size: 14px;
	}

	.fiexd-top .left-part {
		display: flex;
		justify-content: flex-start;
		flex-wrap: nowrap;
		flex-shrink: 1;
		flex-grow: 1;
	}

	.fiexd-top .divider {
		padding: 0 15upx;
	}

	.fiexd-top .my-label,
	.fiexd-top .filter {
		display: inline-block;
		width: 100upx;
	}

	.sec-uni-scroll-view-list {
		width: calc(100vw - 20upx);
		height: calc(100vh - 36px);
		margin-top: 36px;
		padding-right: 10upx;
		color: #606266;

		.my-collapse {
			.my-collapse-item {
				border-top: 1px dashed #E4E7ED;
				padding-top: 10upx;

				.item-line {
					flex: 1;
					font-size: 14px;
					line-height: 50upx;

					.item-label {
						display: inline-block !important;
						width: 150upx !important;
					}
				}

				.item-top {
					display: flex;
					flex-wrap: nowrap;
					justify-content: space-between;
					line-height: 50upx;
					padding: 20upx;

					.item-left {
						flex-shrink: 1;
						flex-grow: 1;
					}

					.item-right {
						align-self: center;

						.uni-tag {
							width: 100upx;
							height: 80upx;
							line-height: 30upx;
							font-size: 13px;
							padding: 20upx 0;
							text-align: center;
							justify-content: center;
							align-items: center;
							border-radius: 50%;
						}

						.uni-tag.uni-tag--success {
							padding: 25upx;
						}

						.arrow-wrap {
							margin-top: 10px;
							text-align: center;

							.my-arrow-down2 {
								width: 50upx;
								height: 50upx;
								line-height: 50upx;
								border: 1px solid #EBEEF5;
								text-align: center;
								border-radius: 50%;
								color: #606266;
								font-size: 20px !important;
							}
						}
					}


				}

				.item-bottom {
					box-sizing: border-box;
					height: 0;
					overflow: hidden;
					background-color: #f5f5f5;
					transition: all 0.5s;

					.item-line {
						padding: 10upx 20upx 0;

						.result-line {
							.result-text {
								padding-left: 30upx;
							}
						}
					}
				}

				.item-bottom.item-bottom-open {
					height: 520upx;
					position: relative;
				}

				.item-bottom.item-bottom-open.item-bottom-fj {
					height: 800upx;
					overflow-y: auto;
				}
			}
		}
	}

	.lu-popup-wrapper {
		.lu-popup-content {
			display: flex;
			align-items: flex-start !important;

			.content {
				display: flex;
				flex-direction: column;
				justify-content: space-between;
				flex: 1;
				height: 100%;

				.button-group {
					align-self: flex-end;

					.margin-left-btn {
						margin-left: 20upx;
					}
				}
			}
		}
	}

	.uni-scroll-view-list .uni-collapse {
		width: 730upx !important;
	}

	.my-popup .uni-popup__wrapper-box .uni-scroll-view-list {
		height: 500upx;
		padding: 32upx 32upx 0;
		font-size: 16px;
	}



	.uni-tag--inverted {
		color: #777 !important;
		/* background-color: #ffffff; */
		border: 1px solid #DCDFE6 !important;
	}

	.my-popup .uni-popup__wrapper-box .uni-radio .uni-radio-input {
		width: 16px !important;
		height: 16px !important;
	}

	uni-toast {
		z-index: 99999999 !important;
	}

	.my-picker {
		height: 48px;
		line-height: 48px;
		flex-grow: 1;
		flex-shrink: 1;

		.uni-input {
			height: 48px;
			line-height: 48px;
		}
	}

	.button-toolbar {
		display: flex;
		width: 100%;
		justify-content: space-between;
		font-size: 16px;
	}

	.top {
		padding: 0 32upx;
		box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
	}

	.uni-form-item .uni-input {
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.pagination-wrap {
		display: flex;
		justify-content: space-between;
		align-items: center;
		width: 710upx;
		padding: 30upx 0;
		color: #777;
		font-size: 14px;
	}

	.my-arrow-down {
		transform: rotate(0deg);
		transition: all 0.5s;
	}

	.my-arrow-down.rotateArrow {
		transform: rotate(180deg);
	}
</style>
